<template>
  <div>
    <!-- {{list[index]}} -->
    <ul style="display: flex; flex-wrap: wrap; margin-bottom: 50px">
      <li v-for="(item, index) in list" :key="index" @click="navClick(index)">
        <van-image class="img" width="100%" height="4rem" :src="item.cover" />
        <h6>{{ item.title }}</h6>
        <p>{{ item.desc }}</p>
        <span>￥{{ item.pprice }}</span>
        <del>原价：{{ item.oprice }}</del>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "list-nav",

  data() {
    return {};
  },

  mounted() {},

  methods: {
    navClick(index) {
      this.$router.push({
        path: "/detail",
        query: {
          detail: JSON.stringify(this.list[index]),
        },
      });
    },
  },
  props: {
    list: {
      type: Object,
    },
  },
};
</script>

<style scoped>
del {
  margin-left: 0.133333rem;
  color: rgb(201, 201, 201);
}
li {
  /* border: 1px solid black; */
  width: 50%;
  padding: 0.266667rem;
  box-sizing: border-box;
  display: inline-block;
}
span {
  color: rgb(255, 102, 0);
  font-weight: bold;
}
</style>